class Solution {
public:
    string largestNumber(vector<int>& nums) {
        vector<string> str1;
        for(auto e:nums)
        {
            str1.push_back(to_string(e));
        }
        sort(str1.begin(),str1.end(),[](const string &s1,const string &s2){return s1+s2>s2+s1;});
        string arr;
        for(auto e:str1)
        {
            arr+=e;
        }
        if(arr[0]=='0')
        {
            return "0";
        }
        return arr;
    }
};
